//
// Created by bill3000 on 2/5/21.
//

#ifndef INTELLI_EVENT_HPP
#define INTELLI_EVENT_HPP

typedef struct CamSettings {
    int camid;
    int width;
    int height;
    float F;
    int speed;
    int ISO;
} CamSettings;

typedef struct LearnedSize {
    int camid;
    int large;
    int middle;
    int small;
} LearnedSize;

typedef struct SizeModel {
    CamSettings cam;
    LearnedSize ls;
} SizeModel;

typedef struct SemiSize {
    int category; //水果的类别，1：大号;2：中号;3：小号
    int cam01;    //1号相机阈值
    int cam02;    //2号相机阈值
    int cam03;    //3号相机阈值
} SemiSize;

typedef struct SugarAnn {
    int serial;
    long nirid;   //We modified the type from int to long !!!!
    float sugar;
    char sugar_img[100];
} SugarAnn;

typedef struct Statistics {
    int large[2];   //大号，很甜，有点甜;
    int middle[2]; //中号，很甜，有点甜;
    int small[2];  //小号，很甜，有点甜;
    int sweet;     //Only by sugar, sweet
    int notsweet;  //Only by sugar, not too sweet
    int defective; //有瑕疵的个数;
} Statistics;

typedef struct Event {
    unsigned int ctype;     //命令，也就是，事件编码
    int param;            //与命令相关的整型参数
    union {  //对特定命令定义更多参数
        char sequence[200];     //附加字符串参数
        int addon;            //附加整型参数
        //命令相关的数据结构，包括但不限于：
        CamSettings cam;
        LearnedSize ls[3];
        SizeModel lsm[3];
        SemiSize ss;
        SugarAnn sa;
        Statistics stat;
    } extra;
} Event;

#endif //INTELLI_EVENT_HPP
